Skip to content

Add STM32 backend (STM32duino / Arduino_Core_STM32)#362

Closed
Tyuyt3975 wants to merge 14 commits into
gin66:masterfrom
Tyuyt3975:master
Closed

Add STM32 backend (STM32duino / Arduino_Core_STM32)#362
Tyuyt3975 wants to merge 14 commits into
gin66:masterfrom
Tyuyt3975:master

Conversation

@Tyuyt3975

Copy link
Copy Markdown

This PR adds a complete STM32 port for FastAccelStepper, targeting the STM32duino toolchain. Step pulses are generated via TIM2/TIM3 compare-match ISR with GPIO BSRR bit-bang, allowing any GPIO pin to be used as a step pin. Deferred queue filling runs in PendSV at the lowest NVIC priority.

@gin66

gin66 commented Jun 10, 2026

Copy link
Copy Markdown
Owner

fails to build

@Tyuyt3975

Tyuyt3975 commented Jun 12, 2026

Copy link
Copy Markdown
Author

Hi @gin66,

Thank you for pointing out the build failure. I've investigated the issues and pushed a fix to the branch. Here's a summary of what was corrected:

  • Resolved compilation errors that prevented the STM32 backend from building under the STM32duino (Arduino_Core_STM32) toolchain.
  • The code now compiles cleanly in my local environment.

The detailed fix plan (root causes, changes made, rationale) is available here:
📄 [https://drive.google.com/file/d/1BzYb1s0h07XRPzQffNESbjDNUOIucDb6/view?usp=sharing]

Note on hardware testing: I currently don't have access to physical STM32 hardware, so runtime validation (step pulse timing, ISR behavior, GPIO correctness) has not been performed. I wanted to be transparent about this limitation.

I'd appreciate a re-review when you have time. Please feel free to leave inline comments if anything else needs attention — I'll address them promptly.

- Phase 2A: Spurious interrupt guard (FAS_SPURIOUS_MAX counter + channel disable)
- Phase 2B: FreeRTOS compile-time warning (configUSE_PORT_OPTIMISED_TASK_SELECTION)
- Phase 2C: NVIC priority documentation for jitter protection
- README: enhanced FreeRTOS compatibility section
@gin66

gin66 commented Jun 12, 2026

Copy link
Copy Markdown
Owner

still gives build error:
(https://github.com/gin66/FastAccelStepper/actions/runs/27421458249/job/81051598777?pr=362)

Thanks for support.

@Tyuyt3975

Copy link
Copy Markdown
Author

still gives build error: (https://github.com/gin66/FastAccelStepper/actions/runs/27421458249/job/81051598777?pr=362)

Thanks for support.

Dear gin66,
nucleo_g070rb (G0) previously fail because it used TIM2 (not exposed in the G0 framework), now pass with 16-bit TIM3.
Hoping it work now

@gin66

gin66 commented Jun 12, 2026

Copy link
Copy Markdown
Owner

Still not ok.

@Tyuyt3975

Copy link
Copy Markdown
Author

Still not ok.

dear gin66,
some change in framework arduino stm32 (redefined macro), so i fixed it. Sorry for inconvenient

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants